package com.huluobo.lib_http

import retrofit2.Retrofit

/**
 *  Created by LC on 2025/5/23.
 *  Retrofit工厂,通过提供一个type,来给出一个具体的retrofit
 */
object NetworkFactory {
    lateinit var retrofit: Retrofit

    fun factory(type: HttpType): Retrofit {
        retrofit = when (type) {
            HttpType.NONE -> {
                NoneRetrofitImpl().createRetrofit()
            }

            HttpType.TOKEN -> {
                TokenRetrofitImpl().createRetrofit()
            }

            HttpType.VIDEO -> {
                VideoRetrofitImpl().createRetrofit()
            }
        }
        return retrofit
    }
}